package com.bawei.module_home.discovery.adapter.provider

import android.os.Handler
import android.os.Looper
import android.widget.ImageView
import android.widget.TextView
import com.bawei.library_common.utils.ImageUtils
import com.bawei.module_home.R
import com.bawei.module_home.discovery.entity.DiscoveryEntity

import com.chad.library.adapter.base.provider.BaseItemProvider
import com.chad.library.adapter.base.viewholder.BaseViewHolder

/**
 * @Author : yaotianxue
 * @Time : On 2023/5/30 09:33
 * @Description : BriefCardProvider
 */
class BriefCardProvider(override val itemViewType: Int, override val layoutId: Int) :BaseItemProvider<DiscoveryEntity.Item>() {
    override fun convert(helper: BaseViewHolder, item: DiscoveryEntity.Item) {
        var  imageView = helper.getView<ImageView>(R.id.iv_cover)
        ImageUtils.loadImageView(context,item.data.icon,imageView)
        var tvTitle = helper.getView<TextView>(R.id.tv_title)
        tvTitle.text = item.data.title.toString()
        var tvDesc = helper.getView<TextView>(R.id.tv_description)
        tvDesc.text = item.data.description.toString()
    }
}